<template>
  <div class="box">
    <div class="allbox">
      <div class="tag_box">
        <div class="tab">{{ this.$route.meta.title }}</div>
      </div>

      <div class="table_box">
        <tabVue :list="inputlist" @onClick="sea()"></tabVue>
        <div class="table_item">
          <el-table :data="tableData" stripe fit>
            <el-table-column prop="realname" label="姓名" width="110"> </el-table-column>
            <el-table-column prop="name" label="代理人证书号"  width="190">
            </el-table-column>
            <el-table-column prop="address" label="执业机构"> </el-table-column>
            <el-table-column prop="duties" label="职务"> </el-table-column>

            <el-table-column label="操作" width="100">
              <template slot-scope="scope">
                <el-button @click="handleClick(scope.row)" type="text"
                  >查看</el-button
                >
              </template>
            </el-table-column>
          </el-table>
        </div>
      </div>
    </div>
  </div>
</template>
  
  <script>
import tabVue from "../../components/tab.vue"; //搜索框组件
export default {
  data() {
    return {
      inputlist: [
        { value: "", name: "姓名" },
        { value: "", name: "执业机构" },
        { value: "", name: "代理人证书号" },
      ],
      formData: {},
      tableData: [],
    };
  },
  components: {
    tabVue: tabVue,
  },
  mounted() {
    this.getinfo();
  },
  methods: {
    /**
     * 获取列表
     */
    getinfo() {
      let that = this;
      let data = that.formData;
      that.$http.post("mechanism/agent", data).then((res) => {
        that.$self.ts(res).then((e) => {
          that.tableData = res.data;
        });
      });
    },
    /**
     * 查询，seach()全局方法
     */
    sea() {
      let that = this;
      const vmodel = ["realname", "mechanism_name", "code"];
      that.formData = this.$self.seach(this.inputlist, vmodel);
      that.getinfo();
      // console.log(formData);
    },
    /**
     * 查看详情
     */
    handleClick(e) {
      // console.log(e)
      this.$router.push({ path: "/cxxq", query: { id: e.id } });
    },
    //  ==
  },
};
</script>
  <style>
</style>